<?php
 header("content-type:text/html;charset=utf-8");
class Server{
    private $name;
    private $s_token = 'shabi';
    private $c_tken;
    private $time;
    private $random;
    private $smt;

    function __construct(){
        $this->name = $_GET['name'];
        $this->time = $_GET['time'];
        $this->random = $_GET['random'];
        $this->smt = $_GET['smt'];
        $this->c_tken = $_GET['tken'];
        $this->login();
    }
    public function login(){
        $arr = array($this->time,$this->s_token,$this->random);
        sort($arr,SORT_STRING);
        $arr = implode($arr,',');
        $math = md5($arr);
        if($this->smt==$math){
            $now =time();
            if($now-$this->time>5){
                $arr = array('code'=>2,'msg'=>"时间超时");
            }else{
                $arr = array('code'=>1,'msg'=>"123".$this->name);
            }
        }else{
            $arr = array('code'=>0,'msg'=>"傻逼，滚！！！！");
        }
        echo json_encode($arr);
    }

}
new Server();